import axios from "../utils/http";
//登录的封装 获取验证码
export function loginModel1(phoneNumber) {
    return axios.get("/api/pcUser/login/send/code/"+phoneNumber)
}

//登录的封装 获取验证码 之后登录

export function loginModel2(phoneNumber,yanZhengMa,) {
    let obj2 = new URLSearchParams();//创建表单对象
    obj2.append('mobile',phoneNumber);
    obj2.append('code',yanZhengMa);
    obj2.append('rememberMe','false');
    return axios.post("/api/pcUser/login/mobile",obj2)
}

//登录的封装 账号密码登录
export function loginModel3(username,password,) {
    let obj3 = new URLSearchParams();//创建表单对象
    obj3.append('username',username);
    obj3.append('password',password);
    obj3.append('rememberMe','true');
    return axios.post("/api/pcUser/login",obj3)
}
//    忘记密码处获取验证码
//登录的封装 账号密码登录
export function loginModel4(username,phone,) {
    let obj4 = new URLSearchParams();//创建表单对象
    obj4.append('loginName',username);
    obj4.append('mobile',phone);
    return axios.post("/api/pcUser/forgetpassword/send/code",obj4)
}
//登录的封装 账号密码登录
export function loginModel5(username,password,phone,code) {
    let obj5 = {
        'loginName':username,
        'password':password,
        'mobile':phone,
        'code':code
    };
    return axios.post("/api/pcUser/password/forget",obj5)
}

//个人中心请求数据
export function personalModel() {
    return axios.get("/api/pcUser/login-user/info")
}

//退出登录
export function exitLogin() {
    return axios.get("/api/pcUser/logout")
}